package homeWork;

import com.sun.deploy.util.ArrayUtil;

import java.util.*;

public class Test2 {
    public static void main(String[]args) {
        HashMap<String,String> map =new HashMap<>();
        map.put("战三","28");
        map.put("战4","28");
        map.put("战5","28");
        //-------Map.values()
        Collection<String> i =map.values();
        Iterator<String> i0 =i.iterator();
        while(i0.hasNext()){
                String i1=i0.next();
                System.out.println(i1);
        }
        System.out.println("---------------------");
        //------Map.keySet;
        Set<String> j=map.keySet();
        Iterator<String>j0=j.iterator();
        while(j0.hasNext()){
            String j1=j0.next();
            String j2=map.get(j1);
            System.out.println("key="+j1+"----value="+j2);
        }
        System.out.println("---------------------");
        //Map.enerySet()
        Set <Map.Entry<String,String>>k=map.entrySet();
        Iterator<Map.Entry<String,String>>k0=k.iterator();
        while(k0.hasNext()){
            Map.Entry<String,String> k1=k0.next();
            String ii0=k1.getKey();
            String ii1=k1.getValue();
            System.out.println("key="+ii0+"----value="+ii1);
        }


    }




}
